package com.dzm.controller;


import com.dzm.entity.Dept;
import com.dzm.service.IDeptService;
import com.dzm.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Dzm
 * @since 2024-08-17
 */
@RestController
@RequestMapping("/dept")
@Api(tags = "部门信息")
public class DeptController {

    @Autowired
    private IDeptService deptService;

    @ApiOperation("部门列表")
    @GetMapping("/list")
    public R list() {
        List<Dept> list =  deptService.findAllDept();

        return R.ok().data("list", list);
    }
}
